import {post, get, dele, put} from '@/utils/serviceHelper.js';

const SMS_LOG_LIST_LIST = "SMS_LOG_LIST_LIST";
const state = {
    smsLogList: [],
    smsLogPage: {page: 0, rows: 10, count: 0}
}

const getters = {
    smsLogList(state) {
        return state.smsLogList;
    },
    smsLogPage(state) {
        return state.smsLogPage;
    }
}

const actions = {
    getSmsLogList({commit, state}, param) {
        get('/manage/sms', {...state.smsLogPage, ...param}).then((res) => {
            if (res.code == 0) {
                commit(SMS_LOG_LIST_LIST, res);
            }
        })
    }
}
const mutations = {
    [SMS_LOG_LIST_LIST](state, data) {
        state.smsLogList = data.rs;
        state.smsLogPage.count = data.count;
    }
}

export default {
    state,
    getters,
    actions,
    mutations
}
